package controllers;

import models.sys.Career;
import ret.Ret;
import swagger.annotations.ApiInfo;
import swagger.annotations.Param;

import java.util.ArrayList;
import java.util.List;

@ApiInfo(desc = "其他一些基础的信息")
public class Utils extends SController {

    @ApiInfo(desc = "获取职业标签列表", consumes = {"application/x-www-form-urlencoded"})
    public static void careers() {
        List<Career> carrers = new ArrayList<Career>();
        carrers.add(new Career());
        renderJSON(Ret.ok().data("careers", carrers));
    }

    @ApiInfo(desc = "添加新的职业标签", consumes = {"application/x-www-form-urlencoded"})
    public static void new_career(
            @Param(name = "name", in = "formData") String name) {
        Career newCareer = new Career();
        newCareer.name = name;
        renderJSON(Ret.ok().data("career", newCareer));
    }

    @ApiInfo(desc = "根据输入提示类别", consumes = {"application/x-www-form-urlencoded"})
    public static void typed_category(
            @Param(name = "name", in = "formData") String name) {
        Career newCareer = new Career();
        newCareer.name = name;
        renderJSON(Ret.ok().data("cates", newCareer));
    }

}
